﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    public static class Assert1
    {
        public static void Throws<TException>(Action action) where TException : Exception
        {
            try
            {
                action();
                Assert.Fail();
            }
            catch (TException)
            {
            }
        }

        public static void DoesNotThrow<TException>(Action action) where TException : Exception
        {
            try
            {
                action();
            }
            catch (TException ex)
            {
                throw new AssertFailedException(ex.Message, ex);
            }
        }
    }
}
